package com.hnkywl.sts.entity.cggl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.htgl.Htwb;
import com.hnkywl.sts.entity.sys.Gg;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-6-11
 * Time: 下午8:38
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_GLFYMX")
@Where(clause = "deleted!='1'")
public class Glfymx extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqGlfymx", allocationSize = 1, sequenceName = "SEQ_BIZ_GLFYMX")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGlfymx")
    private Long id;
    //费用ID
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GLFY_ID")
    private Glfy glfy;
    //物资规格ID
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GG_ID")
    private Gg gg;
    //type=1 估收均摊 type=2 结算均摊
    private Integer type = 1;
    // 均摊费用
    private Double jtfy = 0d;
    //结算均摊费用
    private Double jsjtfy = 0d;
    //入库数量(初始化数据使用)
    private Double rksl;

    //采购单明细ID
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CGDMX_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Cgdmx cgdmx;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Glfy getGlfy() {
        return glfy;
    }

    public void setGlfy(Glfy glfy) {
        this.glfy = glfy;
    }

    public Gg getGg() {
        return gg;
    }

    public void setGg(Gg gg) {
        this.gg = gg;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Double getJtfy() {
        return jtfy;
    }

    public void setJtfy(Double jtfy) {
        this.jtfy = jtfy;
    }

    public Double getJsjtfy() {
        return jsjtfy;
    }

    public void setJsjtfy(Double jsjtfy) {
        this.jsjtfy = jsjtfy;
    }

    public Double getRksl() {
        return rksl;
    }

    public void setRksl(Double rksl) {
        this.rksl = rksl;
    }

    public Cgdmx getCgdmx() {
        return cgdmx;
    }

    public void setCgdmx(Cgdmx cgdmx) {
        this.cgdmx = cgdmx;
    }
}
